package com.bigtalk.pattern.flyweight3;

import java.util.HashMap;
import java.util.Map;

public class WebSiteFactory {
	private Map<String, WebSite> websites = new HashMap<String, WebSite>();
	
	public WebSite getWebSite(String key){
		if( !websites.containsKey(key) ){
			websites.put(key, new ConcreteWebSite(key) );
		}
		return websites.get(key);
	}
	
	public int getCount(){
		return websites.size();
	}
	
}
